package com.artPreter.controller;


import com.artPreter.pojo.EventExhibitionTemp;
import com.artPreter.pojo.Result;
import com.artPreter.service.IEventExhibitionTempService;
import com.artPreter.service.IEventExhibitionTempService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 活动展览模板内容表 前端控制器
 * </p>
 *
 * @author jarvis
 * @since 2025-01-06
 */
@RestController
@RequestMapping("/eventExhibitionTemp")
public class EventExhibitionTempController {


    @Autowired
    private IEventExhibitionTempService eventExhibitionTempService;

    /**
     * 获取活动展览模板，如果没有模板则添加一个新模板
     * @param eventExhibitionTemp
     * @return
     */
    @PostMapping("/getEventExhibitionTemp")
    public Result<EventExhibitionTemp> getEventExhibitionTemp(@RequestBody EventExhibitionTemp eventExhibitionTemp){
        EventExhibitionTemp reulst = eventExhibitionTempService.getEventExhibitionTemp(eventExhibitionTemp);
        return Result.success(reulst);
    }

    @PostMapping("/saveEventExhibitionTemp")
    public Result saveEventExhibitionTemp(@RequestBody EventExhibitionTemp eventExhibitionTemp){
        eventExhibitionTempService.saveEventExhibitionTemp(eventExhibitionTemp);
        return Result.success();
    }

}
